package com.btb.adapter.utils;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ResponseText<T> {
	private int code;
	private String msg;
	private T data;

	public static ResponseText<String> buildFail(String msg) {
		return ResponseText.<String>builder().code(-1).msg(msg).data(null).build();
	}

	public static <T> ResponseText<T> buildSuccess(T t) {
		return ResponseText.<T>builder().code(0).msg("").data(t).build();
	}

}
